package com.object.oriented.exam.system7.controller;

import com.object.oriented.exam.system1.entity.Result;
import com.object.oriented.exam.system7.service.AnalysisService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/analysis")
public class ErrorAnalysisController {

    @Resource
    private AnalysisService analysisService;

    @GetMapping("/paper/{studentId}/{examId}")
    public Result errorAnalysis(@PathVariable("studentId") Long studentId,@PathVariable("examId") Long examId){
        return Result.success(analysisService.getErrorProblem(studentId,examId));
    }
}
